home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Free Software Collection: Marty 1
/
FM Towns Marty 1 Free Software Collection.iso
/
tool
/
otohime
/
otohime.bas
< prev
next >
Wrap
BASIC Source File
|
1993-11-11
|
27KB
|
690 lines
10000 '
10010 ' SOUND EDITOR
10020 '
10030 ' おとひめしちへんげ
10040 ' 音 姫 七 変 化
10050 '
10060 ' by Hiroshi TODA
10070 '
10080 ' 1990 3 25
10090 ' 1993 3 6 (修正)
10100 *INIT
10110 SCREEN@ 0: WIDTH 80,25:COLOR 7,%5,7,4:CLS
10120 T = FRE(4)
10130 IF T < 20000 THEN PRINT "メモリが足りません":END
10140 ON ERROR GOTO *INIT_00
10150 CLEAR,,512,T-20000,20000
10160 GOTO *INIT_02
10170 *INIT_00
10180 RESUME *INIT_01
10190 *INIT_01
10200 PRINT "メモリが足りません":END
10210 *INIT_02
10220 DEFLNG A-Z
10230 MAX = ( FRE(3) - 20000 ) / 3
10240 DIM PCMDATA1%(MAX/2+256),PCMDATA2%(MAX/2+256),DUMMY%(25)
10250 DIM PARAM(100),WORK(100)
10260 '
10270 PCMDATA1%(6)=10:PCMDATA1%(12)=&H620
10280 PCMDATA2%(6)=10:PCMDATA2%(12)=&H620
10290 DUMMY%(6)=10:DUMMY%(12)=&H620
10300 OVDRATE=50:OVMRATE=50
10310 TM!=4:FREQ=19200
10320 EDELAY=1000:EMRATE=100:EDRATE=35
10330 PDELAY=25:PMRATE=100:PDRATE=60
10340 PMODU1=20:PSPEED1=30:PSTART1=0
10350 PMODU2=5:PSPEED2=5:PSTART2=&H10000
10360 VMRATE=25:VRATE=100
10370 VMODU1=20:VSPEED1=80:VSTART1=0
10380 VMODU2=0:VSPEED2=0:VSTART2=&H10000
10390 TRMRATE=25:TRRATE=100:TRSPEED=150
10400 VCYCLE=8:VCMUL!=2
10410 FCMUL!=2
10420 ECYCLE=8:EXAMUL!=1:EXTMUL!=2
10430 FINL=1000:FOUTL=1000:FRATE=500
10440 '
10450 MML1$="V6O3L16EFABEFABFAB>D<FAB>D<V7T-2AB>DE<V8T-2AB>DE6E1"
10460 MML2$="V6O3L2DET-2F4&T-2F4R17.B1"
10470 MML3$="V7O2L2B>DT-2E4&T-2E4R17A<B"
10480 MML4$="V8O3L2R1RE<R17E"
10490 MML5$="@30T83"
10500 PLAY MML5$,MML5$,MML5$,MML5$
10510 PLAY MML1$,MML2$,MML3$,MML4$
10520 '
10530 MOUSE 0:MOUSE 1,20,20,1
10540 TRANS=0:DELAY=1000:VIBRATO=4000:TREMO=7000
10550 VCHAN=9000:FCHAN=11000:ZOOM=13000:SMIX=15000
10560 LOADM "strns.rex",TRANS : LOADM "delay.rex",DELAY
10570 LOADM "vibra.rex",VIBRATO : LOADM "trem.rex",TREMO
10580 LOADM "vchan.rex",VCHAN : LOADM "fchan.rex",FCHAN
10590 LOADM "szoom.rex",ZOOM : LOADM "smix.rex",SMIX
10600 ON ERROR GOTO *ERROR
10610 '
10620 *MAIN
10630 DSP=1
10640 LINE(0,0)-(639,479),PSET,%15,BF,%5
10650 LINE(6,6)-(633,63),PSET,%10,BF,%14
10660 SYMBOL(90,12),"音姫七変化",4,3,%10,,,3,32
10670 SYMBOL(400,70),"by Hiroshi TODA",1.75!,2,%15,,,3
10680 LINE(6,110)-(633,320),PSET,%15,BF,%11
10690 LINE(6,335)-(633,473),PSET,%15,BF,%3
10700 SYMBOL(32,120),"LOAD OVERLAP-LOAD SAVE FILES",2,2
10710 SYMBOL(32,160),"PLAY PLAY-OFF REC DATA-WRITE",2,2
10720 SYMBOL(32,200),"ECHO PHASE-SHIFT VIBRATO TREMOLO",2,2
10730 SYMBOL(32,240),"VOICE-CHANGE FREQENCY-CHANGE EXPAND",2,2
10740 SYMBOL(32,280),"FADE-IN&OUT CANCEL END",2,2
10750 *MAIN_00
10760 CLS 4:LOCATE 24,23
10770 PRINT USING"<< LENGTH = ########Byte ";(PCMDATA1%(6) AND &HFFFF)+PCMDATA1%(7)*&H10000;
10780 PRINT USING"SAMPLING RATE = ####0Hz >>";PCMDATA1%(12)*1.0205!
10790 GOSUB *MOUSE
10800 CLS 4
10810 IF CX<16 OR CY<115 OR CY>355 THEN *MAIN_00
10820 ADR1=VARPTR(PCMDATA1%(0)):PLEN=PEEK(ADR1+12,4)
10830 IF PLEN>=0 AND PLEN=<MAX THEN *MAIN_01
10840 POKE ADR1+12,MAX,4:POKE ADR1+16,0,4:POKE ADR1+20,0,4
10850 *MAIN_01
10860 IF CY>155 THEN *MAIN_02
10870 IF CX<112 THEN *LOAD
10880 IF CX<336 THEN *OVLOAD
10890 IF CX<432 THEN *SAVE
10900 IF CX<544 THEN *FILES
10910 GOTO *MAIN_00
10920 *MAIN_02
10930 IF CY>195 THEN *MAIN_03
10940 IF CX<112 THEN *PLAY
10950 IF CX<272 THEN *PLAY_OFF
10960 IF CX<352 THEN *REC
10970 IF CX<544 THEN *DATA
10980 GOTO *MAIN_00
10990 *MAIN_03
11000 IF CY>235 THEN *MAIN_04
11010 IF CX<112 THEN *ECHO
11020 IF CX<320 THEN *PHASE
11030 IF CX<464 THEN *VIBRA
11040 IF CX<608 THEN *TREMO
11050 GOTO *MAIN_00
11060 *MAIN_04
11070 IF CY>275 THEN *MAIN_05
11080 IF CX<240 THEN *VCHAN
11090 IF CX<512 THEN *FCHAN
11100 IF CX<640 THEN *EXPAND
11110 GOTO *MAIN_00
11120 *MAIN_05
11130 IF CY>315 THEN *MAIN_06
11140 IF CX<224 THEN *FADE
11150 IF CX<352 THEN *CANCEL
11160 IF CX<432 THEN *END
11170 GOTO *MAIN_00
11180 *MAIN_06
11190 GOTO *MAIN_00
11200 '
11210 *LOAD
11220 CALLM TRANS,VARPTR(PCMDATA1%(0)),VARPTR(PCMDATA2%(0))
11230 LOCATE 0,19:LINE INPUT" << LOAD >> File name ",A$
11240 IF INSTR(A$,".")=0 THEN A$=A$+".SND"
11250 LOAD@ A$,PCMDATA1%
11260 GOTO *MAIN_00
11270 '
11280 *OVLOAD
11290 CALLM TRANS,VARPTR(PCMDATA1%(0)),VARPTR(PCMDATA2%(0))
11300 *OVLOAD_00
11310 CLS 4
11320 LOCATE 0,19:PRINT " << OVERLAP-LOAD >> ";
11330 PRINT USING"RATE(disk-data=####% ";OVDRATE;
11340 PRINT USING"memory-data=####%) ";OVMRATE;
11350 PRINT "EXEC EXIT"
11360 *OVLOAD_01
11370 GOSUB *MOUSE
11380 LOCATE 21,21
11390 IF CY<359 OR CY>378 THEN *OVLOAD_01
11400 IF CX<200 THEN *OVLOAD_01
11410 IF CX<332 THEN LINE INPUT "disk-data ";A$:OVDRATE=VAL(A$):GOTO *OVLOAD_02
11420 IF CX<488 THEN LINE INPUT "memory-data ";A$:OVMRATE=VAL(A$):GOTO *OVLOAD_02
11430 IF CX<536 THEN *OVLOAD_03
11440 IF CX<584 THEN *MAIN_00
11450 GOTO *OVLOAD_01
11460 *OVLOAD_02
11470 IF OVDRATE<-100 THEN OVDRATE=-100 ELSE IF OVDRATE>100 THEN OVDRATE=100
11480 IF OVMRATE<-100 THEN OVMRATE=-100 ELSE IF OVMRATE>100 THEN OVMRATE=100
11490 GOTO *OVLOAD_00
11500 *OVLOAD_03
11510 CLS 4:LOCATE 0,19:LINE INPUT" << OVERLAP-LOAD >> File name ",A$
11520 IF INSTR(A$,".")=0 THEN A$=A$+".SND"
11530 LOAD@ A$,PCMDATA1%
11540 PARAM(0)=OVMRATE*2.56!:PARAM(1)=OVDRATE*2.56!:PARAM(2)=MAX
11550 ADR1=VARPTR(PCMDATA2%(0))
11560 ADR2=VARPTR(PCMDATA1%(0))
11570 ADR3=VARPTR(PARAM(0))
11580 ADR4=VARPTR(WORK(0))
11590 CALLM SMIX,ADR1,ADR2,ADR3,ADR4
11600 GOTO *MAIN_00
11610 '
11620 *SAVE
11630 LOCATE 0,19:LINE INPUT" << SAVE >> File name ",A$
11640 IF INSTR(A$,".")=0 THEN A$=A$+".SND"
11650 ADR1=VARPTR(PCMDATA1%(0))
11660 DLEN=PEEK(ADR1+12,4)+32
11670 N=INT(DLEN/256):IF DLEN>256*N THEN N=N+1
11680 D$="a":E$="a":ADR2=1:ADR3=1:ADR4=1:DT1=1:DT2=1:DT3=1:DT4=1
11690 OPEN "R",#1,A$:FIELD #1,128 AS B$,128 AS C$
11700 ADR2=VARPTR(ADR1)
11710 ADR3=VARPTR(D$):DT1=PEEK(ADR3,4):DT2=PEEK(ADR3+4):POKE ADR3+4,128
11720 ADR4=VARPTR(E$):DT3=PEEK(ADR4,4):DT4=PEEK(ADR4+4):POKE ADR4+4,128
11730 FOR I=1 TO N
11740 POKE ADR3,PEEK(ADR2,4),4
11750 LSET B$=D$:ADR1=ADR1+128
11760 POKE ADR4,PEEK(ADR2,4),4
11770 LSET C$=E$:ADR1=ADR1+128:PUT #1
11780 NEXT
11790 CLOSE #1
11800 POKE ADR3,DT1,4:POKE ADR3+4,DT2
11810 POKE ADR4,DT3,4:POKE ADR4+4,DT4
11820 D$="":E$=""
11830 GOTO *MAIN_00
11840 '
11850 *FILES
11860 LOCATE 0,19:LINE INPUT" << FILES >> File descriptor ",A$
11870 DSP=0:CLS
11880 FILES A$:PRINT " Push mouse button"
11890 GOSUB *MOUSE:CLS
11900 GOTO *MAIN
11910 '
11920 *PLAY
11930 PCMPLAY PCMDATA1%
11940 GOTO *MAIN_00
11950 '
11960 *PLAY_OFF
11970 PCMPLAY DUMMY%
11980 GOTO *MAIN_00
11990 '
12000 *REC
12010 CALLM TRANS,VARPTR(PCMDATA1%(0)),VARPTR(PCMDATA2%(0))
12020 IF TM!<0 THEN TM!=0 'TM!は最初にチェックしないとやっかいなので
12030 IF TM!>999 THEN TM!=999
12040 *REC_00
12050 CLS 4
12060 LOCATE 0,19:PRINT " << REC >> ";
12070 PRINT USING"TIME=###.#sec ";TM!;
12080 PRINT USING"SAMPLING-RATE=#####Hz ";FREQ;
12090 PRINT "START PLAY EXIT"
12100 *REC_01
12110 GOSUB *MOUSE
12120 LOCATE 12,21
12130 IF CY<359 OR CY>378 THEN *REC_01
12140 IF CX<88 THEN *REC_01
12150 IF CX<200 THEN LINE INPUT "TIME ";A$:TM!=VAL(A$):GOTO *REC_02
12160 IF CX<384 THEN LINE INPUT "SAMPLING-RATE ";A$:FREQ=VAL(A$):GOTO *REC_02
12170 IF CX<440 THEN *REC_03
12180 IF CX<488 THEN PCMPLAY PCMDATA1%:GOTO *REC_01
12190 IF CX<536 THEN *MAIN_00
12200 GOTO *REC_01
12210 *REC_02
12220 IF FREQ<500 THEN FREQ=500 ELSE IF FREQ>19200 THEN FREQ=19200
12230 RBYTE=TM!*FREQ+32
12240 IF RBYTE>MAX+32 THEN RBYTE=MAX+32:TM!=(RBYTE-32)/FREQ
12250 IF RBYTE<100 THEN RBYTE=100:TM!=(RBYTE-32)/FREQ
12260 GOTO *REC_00
12270 *REC_03
12280 RBYTE=TM!*FREQ+32
12290 CLS 4:LOCATE 15,22:PRINT"Recording"
12300 DIM PCMDATA3%(RBYTE/2-1)
12310 PCMREC PCMDATA3%,FREQ
12320 CLS 4:LOCATE 15,22:PRINT "Wait a minute"
12330 CALLM TRANS,VARPTR(PCMDATA3%(0)),VARPTR(PCMDATA1%(0))
12340 ERASE PCMDATA3%
12350 GOTO *REC_00
12360 '
12370 *DATA
12380 CALLM TRANS,VARPTR(PCMDATA1%(0)),VARPTR(PCMDATA2%(0))
12390 *DATA_00
12400 CLS 4
12410 ADR1=VARPTR(PCMDATA1%(0))
12420 DLEN=PEEK(ADR1+12,4):DLOOP=PEEK(ADR1+16,4):DLPLEN=PEEK(ADR1+20,4)
12430 DSRATE=PEEK(ADR1+24,2)*10.205!
12440 LOCATE 0,19:PRINT " << DATA >> ";
12450 PRINT USING"LEN=###### ";DLEN;
12460 PRINT USING"LOOP=###### ";DLOOP;
12470 PRINT USING"LOOP-LEN=###### ";DLPLEN;
12480 PRINT USING"RATE=####0Hz ";DSRATE*.1!;
12490 PRINT "PLAY EXIT"
12500 *DATA_01
12510 GOSUB *MOUSE
12520 LOCATE 13,21
12530 IF CY<359 OR CY>378 THEN *DATA_01
12540 IF CX<96 THEN *DATA_01
12550 IF CX<192 THEN LINE INPUT "LEN ";A$:DLEN=VAL(A$):GOTO *DATA_02
12560 IF CX<296 THEN LINE INPUT "LOOP ";A$:DLOOP=VAL(A$):GOTO *DATA_02
12570 IF CX<432 THEN LINE INPUT "LOOP-LEN ";A$:DLPLEN=VAL(A$):GOTO *DATA_02
12580 IF CX<544 THEN LINE INPUT "RATE ";A$:DSRATE=VAL(A$):GOTO *DATA_02
12590 IF CX<592 THEN PCMPLAY PCMDATA1%:GOTO *DATA_01
12600 IF CX<640 THEN *MAIN_00
12610 GOTO *DATA_01
12620 *DATA_02
12630 IF DLEN<10 THEN DLEN=10 ELSE IF DLEN>MAX THEN DLEN=MAX
12640 IF DLOOP<0 THEN DLOOP=0 ELSE IF DLOOP>DLEN-1 THEN DLOOP=DLEN-1
12650 IF DLPLEN<0 THEN DLPLEN=0 ELSE IF DLOOP+DLPLEN>DLEN THEN DLPLEN=DLEN-DLOOP
12660 IF DSRATE<10 THEN DSRATE=10 ELSE IF DSRATE>20000 THEN DSRATE=20000
12670 ADR1=VARPTR(PCMDATA1%(0))
12680 POKE ADR1+12,DLEN,4:POKE ADR1+16,DLOOP,4:POKE ADR1+20,DLPLEN,4
12690 POKE ADR1+24,DSRATE/10.205!,2
12700 GOTO *DATA_00
12710 '
12720 *ECHO
12730 CALLM TRANS,VARPTR(PCMDATA1%(0)),VARPTR(PCMDATA2%(0))
12740 *ECHO_00
12750 CLS 4
12760 LOCATE 0,19:PRINT " << ECHO >> ";
12770 PRINT USING"DELAY=#### ";EDELAY;
12780 PRINT USING"RATE(main=###% delay=###%) ";EMRATE;EDRATE;
12790 PRINT "EXEC PLAY CANCEL EXIT"
12800 *ECHO_01
12810 GOSUB *MOUSE
12820 LOCATE 13,21
12830 IF CY<359 OR CY>378 THEN *ECHO_01
12840 IF CX<96 THEN *ECHO_01
12850 IF CX<192 THEN LINE INPUT "DELAY ";A$:EDELAY=VAL(A$):GOTO *ECHO_02
12860 IF CX<232 THEN *ECHO_01
12870 IF CX<316 THEN LINE INPUT "main ";A$:EMRATE=VAL(A$):GOTO *ECHO_02
12880 IF CX<416 THEN LINE INPUT "delay ";A$:EDRATE=VAL(A$):GOTO *ECHO_02
12890 IF CX<464 THEN *ECHO_03
12900 IF CX<512 THEN PCMPLAY PCMDATA1%:GOTO *ECHO_01
12910 IF CX<576 THEN *ECHO_05
12920 IF CX<624 THEN *MAIN_00
12930 GOTO *ECHO_01
12940 *ECHO_02
12950 IF EMRATE<0 THEN EMRATE=0 ELSE IF EMRATE>100 THEN EMRATE=100
12960 IF EDRATE<0 THEN EDRATE=0 ELSE IF EDRATE>100 THEN EDRATE=100
12970 IF EDELAY<0 THEN EDELAY=0 ELSE IF EDELAY>9999 THEN EDELAY=9999
12980 GOTO *ECHO_00
12990 *ECHO_03
13000 PARAM(0)=EDELAY:PARAM(1)=EMRATE*2.56!:PARAM(2)=EDRATE*2.56!
13010 PARAM(3)=0:PARAM(4)=0:PARAM(5)=0
13020 PARAM(6)=0:PARAM(7)=0:PARAM(8)=0
13030 ADR1=VARPTR(PCMDATA1%(0))
13040 ADR2=VARPTR(PARAM(0))
13050 ADR3=VARPTR(WORK(0))
13060 CLS 4:LOCATE 15,22:PRINT "Wait a minute"
13070 DT1=VARPTR(PCMDATA1%(0))
13080 DT2=PEEK(DT1+12,4):IF DT2>=MAX THEN *ECHO_04
13090 DT3=DT2+EDELAY*2:IF DT3>=MAX THEN *ECHO_04
13100 FOR I=INT( DT2*.5!+16 ) TO INT( DT3*.5!+16 )
13110 PCMDATA1%(I)=&H80
13120 NEXT
13130 POKE DT1+12,DT3,4
13140 *ECHO_04
13150 CALLM DELAY,ADR1,ADR2,ADR3
13160 GOTO *ECHO_00
13170 *ECHO_05
13180 CALLM TRANS,VARPTR(PCMDATA2%(0)),VARPTR(PCMDATA1%(0))
13190 GOTO *ECHO_00
13200 '
13210 *PHASE
13220 CALLM TRANS,VARPTR(PCMDATA1%(0)),VARPTR(PCMDATA2%(0))
13230 *PHASE_00
13240 CLS 4
13250 LOCATE 0,19:PRINT " << PHASE >> ";
13260 PRINT USING"DELAY=#### ";PDELAY;
13270 PRINT USING"RATE(main=###% delay=###%) ";PMRATE;PDRATE;
13280 PRINT "EXEC PLAY CANCEL EXIT"
13290 LOCATE 14,20:PRINT USING"PHASE1 (modulation1=#### ";PMODU1;
13300 PRINT USING"speed1=##### start-phase1=######)";PSPEED1;PSTART1
13310 LOCATE 14,21:PRINT USING"PHASE2 (modulation2=#### ";PMODU2;
13320 PRINT USING"speed2=##### start-phase2=######)";PSPEED2;PSTART2
13330 *PHASE_01
13340 GOSUB *MOUSE
13350 LOCATE 14,23
13360 IF CY<359 THEN *PHASE_01
13370 IF CY>378 THEN *PHASE_02
13380 IF CX<104 THEN *PHASE_01
13390 IF CX<200 THEN LINE INPUT "DELAY ";A$:PDELAY=VAL(A$):GOTO *PHASE_04
13400 IF CX<240 THEN *PHASE_01
13410 IF CX<324 THEN LINE INPUT "main ";A$:PMRATE=VAL(A$):GOTO *PHASE_04
13420 IF CX<424 THEN LINE INPUT "delay ";A$:PDRATE=VAL(A$):GOTO *PHASE_04
13430 IF CX<472 THEN *PHASE_05
13440 IF CX<520 THEN PCMPLAY PCMDATA1%:GOTO *PHASE_01
13450 IF CX<584 THEN *PHASE_06
13460 IF CX<632 THEN *MAIN_00
13470 GOTO *PHASE_01
13480 *PHASE_02
13490 IF CY>397 THEN *PHASE_03
13500 IF CX<160 THEN *PHASE_01
13510 IF CX<308 THEN LINE INPUT "modulation1 ";A$:PMODU1=VAL(A$):GOTO *PHASE_04
13520 IF CX<412 THEN LINE INPUT "speed1 ";A$:PSPEED1=VAL(A$):GOTO *PHASE_04
13530 IF CX<584 THEN LINE INPUT "start-phase1 ";A$:PSTART1=VAL(A$):GOTO *PHASE_04
13540 GOTO *PHASE_01
13550 *PHASE_03
13560 IF CY>416 THEN *PHASE_01
13570 IF CX<160 THEN *PHASE_01
13580 IF CX<308 THEN LINE INPUT "modulation2 ";A$:PMODU2=VAL(A$):GOTO *PHASE_04
13590 IF CX<412 THEN LINE INPUT "speed2 ";A$:PSPEED2=VAL(A$):GOTO *PHASE_04
13600 IF CX<584 THEN LINE INPUT "start-phase2 ";A$:PSTART2=VAL(A$):GOTO *PHASE_04
13610 GOTO *PHASE_01
13620 *PHASE_04
13630 IF PMRATE<0 THEN PMRATE=0 ELSE IF PMRATE>100 THEN PMRATE=100
13640 IF PDRATE<0 THEN PDRATE=0 ELSE IF PDRATE>100 THEN PDRATE=100
13650 IF PDELAY<0 THEN PDELAY=0 ELSE IF PDELAY>9999 THEN PDELAY=9999
13660 IF PMODU1<0 THEN PMODU1=0 ELSE IF PMODU1>9999 THEN PMODU1=9999
13670 IF PSPEED1<0 THEN PSPEED1=0 ELSE IF PSPEED1>99999 THEN PSPEED1=99999
13680 IF PSTART1<0 THEN PSTART1=0 ELSE IF PSTART1>&H20000 THEN PSTART1=&H20000
13690 IF PMODU2<0 THEN PMODU2=0 ELSE IF PMODU2>9999 THEN PMODU2=9999
13700 IF PSPEED2<0 THEN PSPEED2=0 ELSE IF PSPEED2>99999 THEN PSPEED2=99999
13710 IF PSTART2<0 THEN PSTART2=0 ELSE IF PSTART2>&H20000 THEN PSTART2=&H20000
13720 GOTO *PHASE_00
13730 *PHASE_05
13740 PARAM(0)=PDELAY:PARAM(1)=PMRATE*2.56!:PARAM(2)=PDRATE*2.56!
13750 PARAM(3)=PMODU1:PARAM(4)=PSPEED1:PARAM(5)=PSTART1
13760 PARAM(6)=PMODU2:PARAM(7)=PSPEED2:PARAM(8)=PSTART2
13770 ADR1=VARPTR(PCMDATA1%(0))
13780 ADR2=VARPTR(PARAM(0))
13790 ADR3=VARPTR(WORK(0))
13800 CLS 4:LOCATE 15,22:PRINT "Wait a minute"
13810 CALLM DELAY,ADR1,ADR2,ADR3
13820 GOTO *PHASE_00
13830 *PHASE_06
13840 CALLM TRANS,VARPTR(PCMDATA2%(0)),VARPTR(PCMDATA1%(0))
13850 GOTO *PHASE_00
13860 '
13870 *VIBRA
13880 CALLM TRANS,VARPTR(PCMDATA1%(0)),VARPTR(PCMDATA2%(0))
13890 *VIBRA_00
13900 CLS 4
13910 LOCATE 0,19:PRINT " << VIBRATO >> ";
13920 PRINT USING"RATE(main=###% vibrato=###%) ";VMRATE;VRATE;
13930 PRINT "EXEC PLAY CANCEL EXIT"
13940 LOCATE 16,20:PRINT USING"VIBRATO1 (modulation1=#### ";VMODU1;
13950 PRINT USING"speed1=##### start-phase1=######)";VSPEED1;VSTART1
13960 LOCATE 16,21:PRINT USING"VIBRATO2 (modulation2=#### ";VMODU2;
13970 PRINT USING"speed2=##### start-phase2=######)";VSPEED2;VSTART2
13980 *VIBRA_01
13990 GOSUB *MOUSE
14000 LOCATE 16,23
14010 IF CY<359 THEN *VIBRA_01
14020 IF CY>380 THEN *VIBRA_02
14030 IF CX<160 THEN *VIBRA_01
14040 IF CX<244 THEN LINE INPUT "main ";A$:VMRATE=VAL(A$):GOTO *VIBRA_04
14050 IF CX<360 THEN LINE INPUT "vibrato ";A$:VRATE=VAL(A$):GOTO *VIBRA_04
14060 IF CX<408 THEN *VIBRA_05
14070 IF CX<456 THEN PCMPLAY PCMDATA1%:GOTO *VIBRA_01
14080 IF CX<520 THEN *VIBRA_06
14090 IF CX<568 THEN *MAIN_00
14100 GOTO *VIBRA_01
14110 *VIBRA_02
14120 IF CY>397 THEN *VIBRA_03
14130 IF CX<192 THEN *VIBRA_01
14140 IF CX<340 THEN LINE INPUT "modulation1 ";A$:VMODU1=VAL(A$):GOTO *VIBRA_04
14150 IF CX<444 THEN LINE INPUT "speed1 ";A$:VSPEED1=VAL(A$):GOTO *VIBRA_04
14160 IF CX<616 THEN LINE INPUT "start-phase1 ";A$:VSTART1=VAL(A$):GOTO *VIBRA_04
14170 GOTO *VIBRA_01
14180 *VIBRA_03
14190 IF CY>416 THEN *VIBRA_01
14200 IF CX<192 THEN *VIBRA_01
14210 IF CX<340 THEN LINE INPUT "modulation2 ";A$:VMODU2=VAL(A$):GOTO *VIBRA_04
14220 IF CX<444 THEN LINE INPUT "speed2 ";A$:VSPEED2=VAL(A$):GOTO *VIBRA_04
14230 IF CX<616 THEN LINE INPUT "start-phase2 ";A$:VSTART2=VAL(A$):GOTO *VIBRA_04
14240 GOTO *VIBRA_01
14250 *VIBRA_04
14260 IF VMRATE<0 THEN VMRATE=0 ELSE IF VMRATE>100 THEN VMRATE=100
14270 IF VRATE<0 THEN VRATE=0 ELSE IF VRATE>100 THEN VRATE=100
14280 IF VMODU1<0 THEN VMODU1=0 ELSE IF VMODU1>9999 THEN VMODU1=9999
14290 IF VSPEED1<0 THEN VSPEED1=0 ELSE IF VSPEED1>99999 THEN VSPEED1=99999
14300 IF VSTART1<0 THEN VSTART1=0 ELSE IF VSTART1>&H20000 THEN VSTART1=&H20000
14310 IF VMODU2<0 THEN VMODU2=0 ELSE IF VMODU2>9999 THEN VMODU2=9999
14320 IF VSPEED2<0 THEN VSPEED2=0 ELSE IF VSPEED2>99999 THEN VSPEED2=99999
14330 IF VSTART2<0 THEN VSTART2=0 ELSE IF VSTART2>&H20000 THEN VSTART2=&H20000
14340 GOTO *VIBRA_00
14350 *VIBRA_05
14360 PARAM(0)=VMODU1+VMODU2:PARAM(1)=VMRATE*2.56!:PARAM(2)=VRATE*2.56!
14370 PARAM(3)=VMODU1:PARAM(4)=VSPEED1:PARAM(5)=VSTART1
14380 PARAM(6)=VMODU2:PARAM(7)=VSPEED2:PARAM(8)=VSTART2
14390 ADR1=VARPTR(PCMDATA1%(0))
14400 ADR2=VARPTR(PARAM(0))
14410 ADR3=VARPTR(WORK(0))
14420 CLS 4:LOCATE 15,22:PRINT "Wait a minute"
14430 CALLM VIBRATO,ADR1,ADR2,ADR3
14440 GOTO *VIBRA_00
14450 *VIBRA_06
14460 CALLM TRANS,VARPTR(PCMDATA2%(0)),VARPTR(PCMDATA1%(0))
14470 GOTO *VIBRA_00
14480 '
14490 *TREMO
14500 CALLM TRANS,VARPTR(PCMDATA1%(0)),VARPTR(PCMDATA2%(0))
14510 *TREMO_00
14520 CLS 4
14530 LOCATE 0,19:PRINT " << TREMOLO >> ";
14540 PRINT USING"RATE(main=###% tremolo=###%) ";TRMRATE;TRRATE;
14550 PRINT USING"SPEED=##### ";TRSPEED;
14560 PRINT "EXEC PLAY CANCEL EXIT"
14570 *TREMO_01
14580 GOSUB *MOUSE
14590 LOCATE 16,21
14600 IF CY<359 OR CY>378 THEN *TREMO_01
14610 IF CX<160 THEN *TREMO_01
14620 IF CX<244 THEN LINE INPUT "main ";A$:TRMRATE=VAL(A$):GOTO *TREMO_02
14630 IF CX<356 THEN LINE INPUT "tremolo ";A$:TRRATE=VAL(A$):GOTO *TREMO_02
14640 IF CX<452 THEN LINE INPUT "SPEED ";A$:TRSPEED=VAL(A$):GOTO *TREMO_02
14650 IF CX<492 THEN *TREMO_03
14660 IF CX<532 THEN PCMPLAY PCMDATA1%:GOTO *TREMO_01
14670 IF CX<588 THEN *TREMO_04
14680 IF CX<632 THEN *MAIN_00
14690 GOTO *TREMO_01
14700 *TREMO_02
14710 IF TRMRATE<0 THEN TRMRATE=0 ELSE IF TRMRATE>100 THEN TRMRATE=100
14720 IF TRRATE<0 THEN TRRATE=0 ELSE IF TRRATE>100 THEN TRRATE=100
14730 IF TRSPEED<0 THEN TRSPEED=0 ELSE IF TRSPEED>99999 THEN TRSPEED=99999
14740 GOTO *TREMO_00
14750 *TREMO_03
14760 PARAM(0)=TRMRATE*2.56!:PARAM(1)=TRRATE*2.56!:PARAM(2)=TRSPEED
14770 PARAM(3)=0
14780 ADR1=VARPTR(PCMDATA1%(0))
14790 ADR2=VARPTR(PARAM(0))
14800 ADR3=VARPTR(WORK(0))
14810 CLS 4:LOCATE 15,22:PRINT "Wait a minute"
14820 CALLM TREMO,ADR1,ADR2,ADR3
14830 GOTO *TREMO_00
14840 *TREMO_04
14850 CALLM TRANS,VARPTR(PCMDATA2%(0)),VARPTR(PCMDATA1%(0))
14860 GOTO *TREMO_00
14870 '
14880 *VCHAN
14890 CALLM TRANS,VARPTR(PCMDATA1%(0)),VARPTR(PCMDATA2%(0))
14900 *VCHAN_00
14910 CLS 4
14920 LOCATE 0,19:PRINT " << VOICE-CHANGE >> ";
14930 PRINT USING"CYCLE=## MULTIPULE=#.###### ";VCYCLE;VCMUL!;
14940 PRINT "EXEC PLAY EXIT"
14950 *VCHAN_01
14960 GOSUB *MOUSE
14970 LOCATE 21,21
14980 IF CY<358 OR CY>378 THEN *VCHAN_01
14990 IF CX<160 THEN *VCHAN_01
15000 IF CX<240 THEN LINE INPUT "CYCLE ";A$:VCYCLE=VAL(A$):GOTO *VCHAN_02
15010 IF CX<400 THEN LINE INPUT "MULTIPULE ";A$:VCMUL!=VAL(A$):GOTO *VCHAN_02
15020 IF CX<448 THEN *VCHAN_03
15030 IF CX<496 THEN PCMPLAY PCMDATA1%:GOTO *VCHAN_01
15040 IF CX<644 THEN *MAIN_00
15050 GOTO *VCHAN_01
15060 *VCHAN_02
15070 IF VCYCLE<1 THEN VCYCLE=1 ELSE IF VCYCLE>99 THEN VCYCLE=99
15080 IF VCMUL!<.2! THEN VCMUL!=.2! ELSE IF VCMUL!>8 THEN VCMUL!=8
15090 GOTO *VCHAN_00
15100 *VCHAN_03
15110 PARAM(0)=VCYCLE:PARAM(1)=VCMUL!*&H10000
15120 ADR1=VARPTR(PCMDATA2%(0))
15130 ADR2=VARPTR(PCMDATA1%(0))
15140 ADR3=VARPTR(PARAM(0))
15150 ADR4=VARPTR(WORK(0))
15160 CLS 4:LOCATE 15,22:PRINT "Wait a minute"
15170 CALLM VCHAN,ADR1,ADR2,ADR3,ADR4
15180 GOTO *VCHAN_00
15190 '
15200 *FCHAN
15210 CALLM TRANS,VARPTR(PCMDATA1%(0)),VARPTR(PCMDATA2%(0))
15220 *FCHAN_00
15230 CLS 4
15240 LOCATE 0,19:PRINT " << FREQENCY-CHANGE >> ";
15250 PRINT USING"MULTIPULE=#.###### ";FCMUL!;
15260 PRINT "EXEC PLAY EXIT"
15270 *FCHAN_01
15280 GOSUB *MOUSE
15290 LOCATE 24,21
15300 IF CY<359 OR CY>378 THEN *FCHAN_01
15310 IF CX<184 THEN *FCHAN_01
15320 IF CX<344 THEN LINE INPUT "MULTIPULE ";A$:FCMUL!=VAL(A$):GOTO *FCHAN_02
15330 IF CX<392 THEN *FCHAN_03
15340 IF CX<440 THEN PCMPLAY PCMDATA1%:GOTO *FCHAN_01
15350 IF CX<488 THEN *MAIN_00
15360 GOTO *FCHAN_01
15370 *FCHAN_02
15380 IF FCMUL!<.2! THEN FCMUL!=.2! ELSE IF FCMUL!>8 THEN FCMUL!=8
15390 GOTO *FCHAN_00
15400 *FCHAN_03
15410 PARAM(0)=FCMUL!*&H10000:PARAM(1)=MAX
15420 ADR1=VARPTR(PCMDATA2%(0))
15430 ADR2=VARPTR(PCMDATA1%(0))
15440 ADR3=VARPTR(PARAM(0))
15450 ADR4=VARPTR(WORK(0))
15460 CLS 4:LOCATE 15,22:PRINT "Wait a minute"
15470 CALLM FCHAN,ADR1,ADR2,ADR3,ADR4
15480 GOTO *FCHAN_00
15490 '
15500 *EXPAND
15510 CALLM TRANS,VARPTR(PCMDATA1%(0)),VARPTR(PCMDATA2%(0))
15520 *EXPAND_00
15530 CLS 4
15540 LOCATE 0,19:PRINT " << EXPAND >> ";
15550 PRINT USING"CYCLE=## MULTIPULE(amp=#.## ";ECYCLE;EXAMUL!;
15560 PRINT USING"time=#.######) ";EXTMUL!;
15570 PRINT "EXEC PLAY EXIT"
15580 *EXPAND_01
15590 GOSUB *MOUSE
15600 LOCATE 15,21
15610 IF CY<359 OR CY>378 THEN *EXPAND_01
15620 IF CX<112 THEN *EXPAND_01
15630 IF CX<192 THEN LINE INPUT "CYCLE ";A$:ECYCLE=VAL(A$):GOTO *EXPAND_02
15640 IF CX<272 THEN *EXPAND_01
15650 IF CX<348 THEN LINE INPUT "amp ";A$:EXAMUL!=VAL(A$):GOTO *EXPAND_02
15660 IF CX<472 THEN LINE INPUT "time ";A$:EXTMUL!=VAL(A$):GOTO *EXPAND_02
15670 IF CX<520 THEN *EXPAND_03
15680 IF CX<568 THEN PCMPLAY PCMDATA1%:GOTO *EXPAND_01
15690 IF CX<616 THEN *MAIN_00
15700 GOTO *EXPAND_01
15710 *EXPAND_02
15720 IF ECYCLE<1 THEN ECYCLE=1 ELSE IF ECYCLE>99 THEN ECYCLE=99
15730 IF EXAMUL!<.2! THEN EXAMUL!=.2! ELSE IF EXAMUL!>8 THEN EXAMUL!=8
15740 IF EXTMUL!<.2! THEN EXTMUL!=.2! ELSE IF EXTMUL!>8 THEN EXTMUL!=8
15750 GOTO *EXPAND_00
15760 *EXPAND_03
15770 PARAM(0)=ECYCLE:PARAM(1)=EXAMUL!*&H10000:PARAM(2)=EXTMUL!*&H10000:PARAM(3)=MAX
15780 ADR1=VARPTR(PCMDATA2%(0))
15790 ADR2=VARPTR(PCMDATA1%(0))
15800 ADR3=VARPTR(PARAM(0))
15810 ADR4=VARPTR(WORK(0))
15820 CLS 4:LOCATE 15,22:PRINT "Wait a minute"
15830 CALLM ZOOM,ADR1,ADR2,ADR3,ADR4
15840 GOTO *EXPAND_00
15850 '
15860 *FADE
15870 CALLM TRANS,VARPTR(PCMDATA1%(0)),VARPTR(PCMDATA2%(0))
15880 *FADE_00
15890 CLS 4
15900 LOCATE 0,19:PRINT " << FADE IN & OUT >> ";
15910 PRINT USING"LENGTH(in=#### out=####) ";FINL;FOUTL;
15920 PRINT USING"RATE=#### ";FRATE;
15930 PRINT "EXEC PLAY EXIT"
15940 *FADE_01
15950 GOSUB *MOUSE
15960 LOCATE 23,20
15970 IF CY<359 OR CY>378 THEN *FADE_01
15980 IF CX<224 THEN *FADE_01
15990 IF CX<292 THEN LINE INPUT "in ";A$:FINL=VAL(A$):GOTO *FADE_02
16000 IF CX<376 THEN LINE INPUT "out ";A$:FOUTL=VAL(A$):GOTO *FADE_02
16010 IF CX<464 THEN LINE INPUT "RATE ";A$:FRATE=VAL(A$):GOTO *FADE_02
16020 IF CX<512 THEN *FADE_03
16030 IF CX<560 THEN PCMPLAY PCMDATA1%:GOTO *FADE_01
16040 IF CX<608 THEN *MAIN_00
16050 GOTO *FADE_01
16060 *FADE_02
16070 IF FINL<0 THEN FINL=0 ELSE IF FINL>9999 THEN FINL=9999
16080 IF FOUTL<0 THEN FOUTL=0 ELSE IF FOUTL>9999 THEN FOUTL=9999
16090 IF FRATE<1 THEN FRATE=1 ELSE IF FRATE>9999 THEN FRATE=9999
16100 GOTO *FADE_00
16110 *FADE_03
16120 CLS 4:LOCATE 15,22:PRINT "Wait a minute"
16130 CALLM TRANS,VARPTR(PCMDATA2%(0)),VARPTR(PCMDATA1%(0))
16140 ADR1=VARPTR(PCMDATA1%(0)):PLEN=PEEK(ADR1+12,4)
16150 IF FINL=0 OR FINL>PLEN THEN *FADE_04
16160 RATE!=1/FRATE:MUL!=1
16170 FOR I=ADR1+FINL+32 TO ADR1+32 STEP-1
16180 DT=PEEK(I)
16190 POKE I,( DT AND &H7F )*MUL!+(DT AND &H80)
16200 MUL!=MUL!-RATE!:IF MUL!<0 THEN MUL!=0
16210 NEXT
16220 *FADE_04
16230 IF FOUTL=0 OR FOUTL>PLEN THEN *FADE_05
16240 RATE!=1/FRATE:MUL!=1
16250 FOR I=ADR1+PLEN-FOUTL+31 TO ADR1+PLEN+31
16260 DT=PEEK(I)
16270 POKE I,( DT AND &H7F )*MUL!+(DT AND &H80)
16280 MUL!=MUL!-RATE!:IF MUL!<0 THEN MUL!=0
16290 NEXT
16300 *FADE_05
16310 GOTO *FADE_00
16320 '
16330 *CANCEL
16340 LOCATE 0,19:PRINT " << CANCEL >> Are you sure? (YES NO)"
16350 *CANCEL_01
16360 GOSUB *MOUSE
16370 IF CY<359 OR CY>378 THEN *CANCEL_01
16380 IF CX<224 THEN *CANCEL_01
16390 IF CX<272 THEN *CANCEL_02
16400 IF CX<312 THEN *MAIN_00
16410 GOTO *CANCEL_01
16420 *CANCEL_02
16430 CALLM TRANS,VARPTR(PCMDATA2%(0)),VARPTR(PCMDATA1%(0))
16440 GOTO *MAIN_00
16450 '
16460 *END
16470 LOCATE 0,19:PRINT " << END >> Are you sure? (YES NO)"
16480 *END_01
16490 GOSUB *MOUSE
16500 IF CY<361 OR CY>380 THEN *END_01
16510 IF CX<200 THEN *END_01
16520 IF CX<248 THEN *END_02
16530 IF CX<288 THEN *MAIN_00
16540 GOTO *END_01
16550 *END_02
16560 END
16570 '
16580 *MOUSE
16590 IF MOUSE(2,0) THEN SW=0:GOTO *MOUSE_01
16600 IF MOUSE(2,1) THEN SW=1:GOTO *MOUSE_01
16610 GOTO *MOUSE
16620 *MOUSE_01
16630 IF MOUSE(2,SW) THEN *MOUSE_01
16640 CX=MOUSE(4,SW):CY=MOUSE(5,SW)
16650 RETURN
16660 '
16670 *ERROR
16680 ADR1=VARPTR(PCMDATA1%(0)):PLEN=PEEK(ADR1+12,4)
16690 IF PLEN>=0 AND PLEN=<MAX THEN *ERROR_00
16700 POKE ADR1+12,MAX,4:POKE ADR1+16,0,4:POKE ADR1+20,0,4
16710 *ERROR_00
16720 IF ERR=53 THEN A$="Device I/O error": GOTO *ERROR_01
16730 IF ERR=55 THEN A$="Bad file descriptor": GOTO *ERROR_01
16740 IF ERR=60 THEN A$="Device unavailable": GOTO *ERROR_01
16750 IF ERR=63 THEN A$="File not found": GOTO *ERROR_01
16760 IF ERR=67 THEN A$="Disk full": GOTO *ERROR_01
16770 IF ERR=72 THEN A$="Drive not ready": GOTO *ERROR_01
16780 IF ERR=73 THEN A$="Disk write protected": GOTO *ERROR_01
16790 IF ERR=83 THEN A$="Out of memory": GOTO *ERROR_01
16800 A$="Error = "+STR$(ERR)+" in "+STR$(ERL)
16810 *ERROR_01
16820 CLOSE
16830 CLS 4:LOCATE 15,20:PRINT A$
16840 LOCATE 15,22:PRINT "Push mouse button"
16850 BEEP 1:FOR I=0 TO 10000:NEXT:BEEP 0
16860 IF MOUSE(2,0) = 0 THEN 16860
16870 IF MOUSE(2,0) THEN 16870
16880 IF DSP THEN RESUME *MAIN_00 ELSE RESUME *MAIN